import { RouteRecordRaw } from "vue-router";
import MyQuestion from "@/views/question/MyQuestion.vue";
import QuestionBank from "@/views/questionBank/QuestionBank.vue";
import HomeView from "@/views/HomeView.vue";
import UserManager from "@/views/user/UserManagement.vue";
import accessEnum from "@/access/accessEnum";
import QuestionBankManagement from "@/views/questionBank/QuestionBankManagement.vue";
import QuestionManagement from "@/views/question/QuestionManagement.vue";
import OJTemplate from "@/views/ojTemplate/OJTemplate.vue";
import QuestionBankDetail from "@/views/questionBank/QuestionBankDetail.vue";
import UserInfo from "@/views/user/UserInfo.vue";
import QuestionDetail from "@/views/question/QuestionDetail.vue";
import ViewQuestionView from "@/views/ojQuestion/ViewQuestionView.vue";
import ACCESS_ENUM from "@/access/accessEnum";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "主页",
    component: HomeView,
  },
  {
    path: "/tiku",
    name: "题库",
    component: QuestionBank,
  },
  {
    path: "/timu",
    name: "题目",
    component: MyQuestion,
  },
  {
    path: "/timuDetail",
    name: "题库详情页",
    component: QuestionBankDetail,
    meta: {
      access: accessEnum.ADMIN,
      hideInMenu: true,
    },
  },
  {
    path: "/yonghu",
    name: "用户管理",
    component: UserManager,
    meta: {
      access: accessEnum.ADMIN,
    },
  },
  {
    path: "/tikuManager",
    name: "题库管理",
    component: QuestionBankManagement,
    meta: {
      access: accessEnum.ADMIN,
    },
  },
  {
    path: "/timuManager",
    name: "题目管理",
    component: QuestionManagement,
    meta: {
      access: accessEnum.ADMIN,
    },
  },
  {
    path: "/ojtemplate",
    name: "OJ平台",
    component: OJTemplate,
    meta: {
      access: accessEnum.ADMIN,
    },
  },
  {
    path: "/user/info",
    name: "用户信息",
    component: UserInfo,
    meta: {
      access: accessEnum.ADMIN,
      hideInMenu: true,
    },
  },
  {
    path: "/questionDetail",
    name: "题目详情",
    component: QuestionDetail,
    meta: {
      access: accessEnum.ADMIN,
      hideInMenu: true,
    },
  },
  {
    path: "/view/question/:id",
    name: "在线做题",
    component: ViewQuestionView,
    props: true,
    meta: {
      access: ACCESS_ENUM.ADMIN,
      hideInMenu: true,
    },
  },
];

export default routes;
